package com.hoo.utils;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class ReadUtil {
	/**
	 * 
	 * @param path
	 * @return
	 */
	public static String readJson(String path) {
		File file = new File(path);
		Scanner scanner = null;
		StringBuilder buffer = new StringBuilder();
		try {
			scanner = new Scanner(file, "utf-8");
			while (scanner.hasNextLine()) {
				buffer.append(scanner.nextLine());
			}

		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
		String json = buffer.toString();
		System.out.println(json);
		return json;
	}
}
